<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>setup函数的使用</title>
    <style>
      

    </style>
  </head>
  <body>
    <!--<script src="https://unpkg.com/vue@next"></script>
    <div id="root"></div>

    <script>

        
      const app = Vue.createApp({
        template: `
                    <div @click="hanleClick">name:{{name}} age:{{age}}</div>
                `,

        methods: {
          test() {
            console.log(this.$options.setup());
          },
        },

        mounted() {
          this.test();
        },

        // created 实例被完全初始化之前
        setup(props, context) {
          return {
            name: "云牧",
            age: 18,
            hanleClick: () => {
              alert(666);
            },
          };
        },
      });

      const vm = app.mount("#root");
    </script>-->
  </body>
</html>
